import '../public.dart';
import './dialog/popRoute.dart';
import 'dialog/botton_input_dialog.dart';
import 'package:fluttertoast/fluttertoast.dart';

class Toast {
  static void show(String msg) {
    Fluttertoast.showToast(
      msg: msg,
      gravity: ToastGravity.CENTER,
      fontSize: 12,
    );
  }

  static void inputDialog({
    String title = '内容',
    required TextEditingController textEditingController,
    TextInputType type = TextInputType.text,
    required Function(String) confirm,
    int? maxLength,
  }) {
    RouterHelper.navigator.push(
      PopRoute(
        child: BottomInputDialog(
          textEditingController: textEditingController,
          maxLength: maxLength,
          title: title,
          type: type,
          confirm: confirm,
        ),
      ),
    );
  }
}
